function main(params) {
    debugger;
    var self = this;
    console.log(params); // 节点参数

    // 定义需要处理的列表组件配置
    var tableConfigs = [
        {listId: "page_widget_list_b5dp5d", tableId: "table_ca62hf"},
        {listId: "page_widget_list_35fk13", tableId: "table_ca62hf"},
        {listId: "page_widget_list_9fwuzp", tableId: "table_hcg2ga"}
    ];

    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('3a37a116-4da3-4e54-9f1d-e1b2c3ff79ad','" + params.id + "',['unit_id'])")
        .then(function (res) {
            var regionIdList = res.result;

            // 统一处理所有列表
            tableConfigs.forEach(function (config) {
                var pageTableList = self.$$(config.listId);
                if (pageTableList && pageTableList.dataEngine && pageTableList.dataEngine.state) {
                    if (pageTableList.$children && pageTableList.$children[0]) {
                        pageTableList.$children[0].$$setExtraParams({unitId: regionIdList});
                    }

                    var tableComp = pageTableList.dataEngine.state.getElement(config.tableId);
                    if (tableComp && tableComp.$$refreshData) {
                        tableComp.$$refreshData();
                    }
                }
            });
        })
        .catch(function (err) {
            if (self.$message && self.$message.error) {
                self.$message.error(err.message);
            }
            console.error("API调用失败:", err);
        });
}


function main(params) {
    debugger
    var self = this;
    // 节点参数
    console.log(params);

    let pageTableList = self.$$("page_widget_list_b5dp5d");
    let queryElement = pageTableList.dataEngine.state.getElement("query_field_wrapper_hl8wk5");

    let pageTableList1 = self.$$("page_widget_list_35fk13");
    let queryElement1 = pageTableList1.dataEngine.state.getElement("query_field_wrapper_9ihybb");

    let pageTableList2 = self.$$("page_widget_list_9fwuzp");
    let queryElement2 = pageTableList2.dataEngine.state.getElement("query_field_wrapper_9g2mlr");

    api.EXEC_FORMULA("TREE_QUERY_CHILDRENS('3a37a116-4da3-4e54-9f1d-e1b2c3ff79ad','" + params.id + "',['unit_id'])").then((res) => {
        // then() 为调用成功的回调
        // 获取所有子区划
        var regionIdList = res.result

        // 找到页面中的列表组件元素
        if (pageTableList) {
            if (pageTableList.dataEngine && pageTableList.dataEngine.state) {

                if (queryElement && queryElement.data && queryElement.data.members) {
                    const queryProjectIdModel = queryElement.data.members[0];
                    queryProjectIdModel.props.defaultValue.value = regionIdList;

                    const queryProjectIdModel1 = queryElement1.data.members[0];
                    queryProjectIdModel1.props.defaultValue.value = regionIdList;

                    const queryProjectIdModel2 = queryElement2.data.members[0];
                    queryProjectIdModel2.props.defaultValue.value = regionIdList;

                }
                let tableCondition = pageTableList.dataEngine.state.getElement("condition_fb83py");
                let tableCondition1 = pageTableList1.dataEngine.state.getElement("condition_fb83py");
                let tableCondition2 = pageTableList2.dataEngine.state.getElement("condition_aeng5g");

                if (tableCondition) {
                    tableCondition.onQuery();
                    tableCondition1.onQuery();
                    tableCondition2.onQuery();
                }

            }
        }
    }).catch(err => {
        self.$message.error(err.message); // 显示错误提示信息
    });
}
